<template functional>
  <a-sub-menu :key="props.subMenu.key">
    <span slot="title">
      <a-icon v-if="props.subMenu.icon" :type="props.subMenu.icon" />
      <span>{{ props.subMenu.name }}</span>
    </span>
    <template v-for="(menuItem, index) in props.subMenu.children">
      <a-menu-item v-if="!menuItem.children || menuItem.children.length == 0" :key="menuItem.key">
        <a-icon v-if="menuItem.icon" :type="menuItem.icon" />
        <span>{{ menuItem.name }}</span>
      </a-menu-item>
      <custom-sub-menu v-else :subMenu="menuItem" :key="index"></custom-sub-menu>
    </template>
  </a-sub-menu>
</template>